package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
@Getter@Setter
public class StrategyGrandSonComment extends BaseDomain{
    public final static Integer REPLY_SON = 0; //回复一级评论的
    public final static Integer REPLY_GRANDSON = 1;//回复二级评论的
    //二级子评论内容
    private String content;
    //一级子评论对象
    private StrategySonComment strategySonComment;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    //评论者
    private User user;
    //二级回复的类型
    private Integer replyType =REPLY_SON;
    //二级回复的二级回复
    private StrategyGrandSonComment strategyGrandSonComment;
    //内回复中的被回复者
    private User replyUser;

    //获得回复某人的语句
    public String getReplySentence(){
        if (replyType==REPLY_GRANDSON){
            return "回复:"+replyUser.getNickName();
        }else {
            return null;
        }
    }
}